package me.zhenqu.redis.utils;

import java.nio.ByteBuffer;
import java.util.Collection;

/**
 * Created by IntelliJ IDEA.
 * User: yibing.tan
 * Date: 11-11-14
 * Time: 下午4:28
 * To change this template use File | Settings | File Templates.
 */
public interface JavaObjectSerializer {
    public <T> T readObject(ByteBuffer buffer, Class<T> t);

    public <T> T readObject(byte[] buffer, Class<T> t);

    public ByteBuffer writeObject(int maxSize, Object o);

    public byte[] writeObjectToArray(int maxSize, Object o);

    public <T> Collection<T> readObjectArray(byte[] buffer, Class<T> t);

    public Object readFullObject(byte[] buffer);
    public byte[] writeFullObject(int maxSize, Object o);
}
